// var {test, say} = require("./test");
const fs= require('fs');
var {say} = require('./test');
var buf1 = Buffer.alloc(10);
var buf2 = Buffer.from('hello buffer');

let r1 = buf1.toJSON();

let r2 = buf2.toJSON();
console.log('r1:');
console.log(r1);

console.log('r2:');
console.log(r2);

console.log('buf1 length:'+buf1.length);  //10- 10字节

console.log('buf2 length:'+buf2.length);  //2

buf1.write('Buffer really rocks.');

buf1.toString();

let rs = fs.createReadStream('./test.txt',{highWaterMark: 11});
rs.on('open', ()=>{
    console.log('文件打开了');
})
let chunks = [];
rs.on('data', (err, chunk)=>{
    chunks.push(chunk);
})
console.log(rs);

// test();

say();